package cn.lnfvc.controller;

import cn.lnfvc.mapper.UserMapper;
import cn.lnfvc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@Controller
@ResponseBody
public class UserController {
    @Autowired
    private UserMapper userMapper;

//    查询方法
//    @GetMapping("/user")
    @RequestMapping(value = "/user",produces = {"application/json;charset=UTF-8"})
    public List query(){
        List<User> list = userMapper.selectList(null);
        System.out.println(list);
        return list;
    }


}
